import React from 'react';
import Menu from '@/components/common/menu';
import styles from '@/assets/css/user.module.css';

const BusinessIndex = () => {
    let navigate = React.Router.useNavigate();
    // 退出登陆
    const Logout = () => {
        React.UI.Dialog.confirm({
            title: '退出',
            content: '确认是否退出登陆?',
            onConfirm: () => 
            {
                navigate('/business/login')
            }
        }).catch(() => { })
    }
    return (
        <>
            <div className={styles.header}>
                <div className={styles.userinfo}>
                    <div className={styles.avatar}>
                        <img src={require('@/assets/images/avatar.png')} alt="" />
                    </div>
                    <div className={styles.nickname}>admin</div>
                    <div className={`${styles.nickname} ${styles.content}`}>这家伙很懒，什么也没写！</div>
                </div>
                <div className={styles.corrugated}>
                    <div className={`${styles.wave_top} ${styles.wave_item}`}></div>
                    <div className={`${styles.wave_middle} ${styles.wave_item}`}></div>
                </div>
            </div>
            <div className={styles.menu_cell}>
                <div className={styles.item}>
                    <React.Router.NavLink to="/business/profile" >
                        <div className={styles.title}>个人资料</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </React.Router.NavLink>
                </div>
                <div className={styles.item}>
                    <React.Router.NavLink to="/business/email" >
                        <div className={styles.title}>邮箱认证</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </React.Router.NavLink>
                </div>
                <div className={styles.item}>
                    <React.Router.NavLink to="/guest/index" >
                        <div className={styles.title}>住客信息</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </React.Router.NavLink>
                </div>
                <div className={styles.item}>
                    <React.Router.NavLink to="/order/index" >
                        <div className={styles.title}>房间订单</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </React.Router.NavLink>
                </div>
                <div className={styles.item}>
                    <React.Router.NavLink to="/business/coupon" >
                        <div className={styles.title}>我的优惠券</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </React.Router.NavLink>
                </div>
                <div className={styles.item}>
                    <React.Router.NavLink to="/business/about" >
                        <div className={styles.title}>关于我们</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </React.Router.NavLink>
                </div>
                <div className={styles.item}>
                    <a onClick={Logout}>
                        <div className={styles.title}>退出登陆</div>
                        <div className={styles.icon}>
                            <img src={require('@/assets/images/right.png')} alt="" />
                        </div>
                    </a>
                </div>
            </div>
            {/* 底部 */}
            <div className={styles.footer}>
                <Menu />
            </div>
        </>
    )
}

export default BusinessIndex;

